package cn.syc.struck.demo.base;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;

import com.hwangjr.rxbus.RxBus;

/**
 * Created by czz on 2016/12/5.
 */

public abstract class BaseActivity extends AppCompatActivity {

    //public static final String CTAG = BaseFragment.class.getSimpleName();

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(getLayoutId());
        RxBus.get().register(this);
        afterCreate(savedInstanceState);
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        RxBus.get().unregister(this);
    }

    protected abstract int getLayoutId();

    protected abstract void afterCreate(Bundle savedInstanceState);
}
